package 蓝桥杯.算法板子.数学;

import java.io.*;
import java.util.StringTokenizer;
import java.io.*;
import java.math.BigInteger;
import java.util.StringTokenizer;
/**
 * @Title: 筛质数
 * @Author 贾金博
 * @Package 蓝桥杯.算法板子.数学
 * @Date 2024/4/12 20:19
 * @description:
 */
public class 筛质数 {
    public static FastReader sc = new FastReader();
    public static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    public static Integer rl = 1000010;

    public static int[] primes = new int[rl];
    public static int[] f = new int[rl];
    public static int cnt = 0;

    public static void main(String[] args) {

        Long n = sc.nextLong();
        is_prime(n);
        out.println(cnt);
        //记得刷新流
        out.flush();
    }

    public static void is_prime(Long n) {
        for(int i = 2; i <= n; ++ i ) {
            if(f[i] == 0) {
                primes[++ cnt] = i;
            }
            for(int j = 1; primes[j] <= n / i; ++ j ) {
                f[i * primes[j]] = 1;
                if(i % primes[j] == 0) {
                    break;
                }
            }
        }
    }
}

//快读的模板
//class FastReader{
//    StringTokenizer st;
//    BufferedReader br;
//    public FastReader(){
//        br=new BufferedReader(new InputStreamReader(System.in));
//    }
//
//    String next(){
//        while (st==null||!st.hasMoreElements()){
//            try {
//                st=new StringTokenizer(br.readLine());
//            }catch (IOException e){
//                e.printStackTrace();
//            }
//        }
//        return st.nextToken();
//    }
//    int nextInt() {
//        return Integer.parseInt(next());
//    }
//
//    long nextLong() {
//        return Long.parseLong(next());
//    }
//    double nextDouble() {
//        return Double.parseDouble(next());
//    }
//    String nextLine() {
//        String str = "";
//        try {
//            str = br.readLine();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return str;
//    }
//}
